import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter_sample/pages/dart/EMPButton.dart';

class ReadDataPage extends StatefulWidget {
  const ReadDataPage({super.key});

  @override
  State<ReadDataPage> createState() => _ReadDataPageState();
}

class _ReadDataPageState extends State<ReadDataPage> {
  String message = "";

  @override
  void initState() {
    super.initState();
    message = Platform.localeName;
  }

  @override
  Widget build(BuildContext context) {
    MediaQueryData data = MediaQuery.of(context);
    debugPrint("get MediaQueryData ${data.padding}");
    return Row(
      children: [
        Expanded(
          child: Column(
            children: [
              Text(message),
              const SizedBox(height: 10),
              Text("viewInsets: ${data.viewInsets}"),
              Text("systemGestureInsets: ${data.systemGestureInsets}"),
              const SizedBox(height: 10),
              Text("padding: ${data.padding}"),
              Text("padding: l${data.padding.left}, r${data.padding.right}, t${data.padding.top}, b${data.padding.bottom}"),
              Text("viewPadding: ${data.viewPadding}"),
              const SizedBox(height: 10),
              const EMPButton(text: "测试demo"),
              const EMPButton(text: "测试demo, isDark=false", isDark: false),
            ],
          ),
        ),
      ],
    );
  }
}
